package cn.openea.perpartner.wxpay.config;

import cn.openea.perpartner.wxpay.wxpaysdk.MyWxPayConfig;
import cn.openea.perpartner.wxpay.wxpaysdk.WXPay;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import java.io.IOException;

/**
 * @Name: 微信支付初始化并放入Ioc中管理
 * @author: Mr.Yun
 * @Created: 2022/10/13 20:56
 */
@Configuration
public class WxConfig {

    @Bean
    public MyWxPayConfig getMyWxPayConfig() throws IOException {
        MyWxPayConfig myWxPayConfig = new MyWxPayConfig();
        return myWxPayConfig;
    }

    @Bean
    public WXPay getWXPay(MyWxPayConfig myWxPayConfig) throws Exception {
        return new WXPay(myWxPayConfig);
    }

}
